﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "mythread.h"

#include <opencv.hpp>
#include <video.hpp>
#include <videoio.hpp>
#include <cvconfig.h>

#include <QDebug>
#include <QStatusBar>
#include <QFileDialog>
#include <QMessageBox>
#include <QtMath>

using namespace cv;
using namespace std;

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    cv::Mat TemplateImage;
    int number_count;
    QString strnumber;

private:
    Ui::MainWindow *ui;

    MyThread *mythread;

    cv::Mat Frame;


    QImage ShowImage;

    QImage CutImage;

    QImage MatToQImage(const cv::Mat& mat);

    bool signal_cutimg;
    bool signal_startTemplate;

signals:
    void signalShow();

private slots:

    void OpenClicked();
    void CloseClicked();

    void GetImageClicked();
    void SaveImageClicked();

    void StartTemplateClicked();
    void LoadTemplateClicked();

    void sl_ShowImage(Mat& src);
    void sl_ShowNumber(int number);


};

#endif // MAINWINDOW_H
